﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for clsDSDeThi
/// </summary>
public class clsDSDeThi
{
    DataClassesDataContext db = new DataClassesDataContext();
	public clsDSDeThi()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    private string MaDT;

    public string MaDT1
    {
        get { return MaDT; }
        set { MaDT = value; }
    }
    private string TenBT;

    public string TenBT1
    {
        get { return TenBT; }
        set { TenBT = value; }
    }
   

    public List<clsDSDeThi> danhsachdedathi(string mathisinh)
    {
        var dedathi = (from p in db.tbl_BAITHIs
                       where p.MsSinhVien == mathisinh
                       select new clsDSDeThi
                       {
                           MaDT = p.MaDT,
                           TenBT=p.TenBaiThi
                       }).ToList();
        return dedathi;
    }
    public int kiemtradethi(string madt, string mathisinh)
    {
        foreach (var madtoflistbt in danhsachdedathi(mathisinh))
        {
            if (string.Compare(madtoflistbt.MaDT,madt)==0)
            {
                return 1;
            }
        }
        return 0;
 
    }
}
